#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> hash;
        int l, r;
        for (int i = 0;i < nums.size();i++)
        {
            if (hash.count(target - nums[i]))
            {
                l = hash[target - nums[i]];
                r = i;
                break;
            }
            hash[nums[i]] = i;
        }
        return { l,r };
    }
};